import { lazy } from "react";
import {RouteItem} from '../type/index'
import { HomeOutlined,EnvironmentOutlined,ProfileOutlined,TeamOutlined,MedicineBoxOutlined,UserOutlined,ShopOutlined,ScheduleOutlined } from '@ant-design/icons';

const Home = lazy(() => import('../pages/Home/index'));
const Login = lazy(() => import('../pages/Login/index'));
const Layout = lazy(() => import('../pages/Layout/index'));
const Address = lazy(() => import('../pages/Address/index'));
const Department = lazy(() => import('../pages/Department/index'));
const Doctor = lazy(() => import('../pages/Doctor/index'));
const Drug = lazy(() => import('../pages/Drug/index'));
const Hospital = lazy(() => import('../pages/Hospital/index'));
const My = lazy(() => import('../pages/My/index'));
const Register = lazy(() => import('../pages/Register/index'));

export const RouterChildren:RouteItem[] = [
    {
        path:'/',
        element:<Home/>,
        meta:{
            label:'首页',
            icon:<HomeOutlined />,
            role:['user']
        }
    },
    {
        path:'/Address',
        element:<Address/>,
        meta:{
            label:'地址管理',
            icon:<EnvironmentOutlined />,
            role:['admin']
        }
    },
    {
        path:'/Department',
        element:<Department/>,
        meta:{
            label:'科室管理',
            icon: <ProfileOutlined />,
            role:['admin']
        }
    },
    {
        path:'/Doctor',
        element:<Doctor/>,
        meta:{
            label:'医生管理',
            icon:<TeamOutlined />,
            role:['admin']
        }
    },
    {
        path:'/Drug',
        element:<Drug/>,
        meta:{
            label:'药品',
            icon:<MedicineBoxOutlined />,
            role:['admin']
        }
    },
    {
        path:'/Hospital',
        element:<Hospital/>,
        meta:{
            label:'医院',
            icon:<ShopOutlined />,
            role:['admin']
        }
    },
    {
        path:'/My',
        element:<My/>,
        meta:{
            label:'个人信息',
            icon:<UserOutlined />,
            role:['user']
        }
    },
    {
        path:'/Register',
        element:<Register/>,
        meta:{
            label:'挂号',
            icon:<ScheduleOutlined />,
            role:['admin']
        }
    },
]

export const routes:RouteItem[] = [
    {
        path:'/login',
        element:<Login/>,
    },
    {
        path:'/',
        element:<Layout/>,
        children:RouterChildren
    },
]

